home *** CD-ROM | disk | FTP | other *** search
/ Internet.Works 39 / Issue 39.iso / pc / PCSoftware / AceHTML 4.0 / AceHTML4Pro.exe / %MAINDIR% / ScriptDef / Days Till Date.sd < prev    next >
Encoding:
INI File  |  2000-08-31  |  855 b   |  43 lines

  1. [SUBJECT]
  2. Description=Displays how many days until a given date
  3. ImageIndex=-1
  4. Folder=Quick JavaScript
  5.  
  6.  
  7. [BODY_TEXT]
  8. ;<SCRIPT LANGUAGE="JavaScript">
  9. ;<!-- Begin
  10. ;var date = new Date("`date`");
  11. ;var description = "`description`";
  12. ;var now = new Date();
  13. ;var diff = date.getTime() - now.getTime();
  14. ;var days = Math.floor(diff / (1000 * 60 * 60 * 24));
  15. ;document.write("<center><h3>")
  16. ;if (days > 1) {
  17. ;document.write(days+1 + " days until " + description);
  18. ;}
  19. ;else if (days == 1) {
  20. ;document.write("Only two days until " + description);
  21. ;}
  22. ;else if (days == 0) {
  23. ;document.write("Tomorrow is " + description);
  24. ;}
  25. ;else {
  26. ;document.write("It's" + description + "!");
  27. ;}
  28. ;document.write("</h3></center>");
  29. ;// End -->
  30. ;</script>
  31. ;
  32.  
  33.  
  34. [`date`]
  35. Kind=S
  36. Value=January 1, 2003
  37.  
  38. [`description`]
  39. Kind=S
  40. Value=the year 2003
  41.  
  42.  
  43.